<!DOCTYPE html>
<html lang="cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    // 输出从0到100
    // for (i = 0; i <= 100; i++) {
    //     document.write(i + "<br>");
    // }
    let i = 0;

    while (i <= 100) {
        document.write(i + "<br>while循环");
        i++;
    }


    // 输出从0到100之间偶数的和
    let total = 0;
    for (i = 0; i <= 100; i++) {
        if (i % 2 == 0) {
            total = total + i;
        }
    }
    document.write("和为:" + total);
</script>